'use strict'

import HufuEcharts from './index.jsx'

/**
 * 饼状图表，继承至HufuEcharts
 */
export default class HufuEchartsPie extends HufuEcharts {
  constructor(props) {
    super(props)
    this.options = {
      tooltip: {
        trigger: 'item',
        formatter: '{a} <br/>{b}: {c} ({d}%)',
      },
      color: ['#407FFF', '#FD5F5F', '#80C2FD', '#FFBA00', '#52c41a'],
      legend: {
        icon: 'rect',
        type: 'scroll',
        orient: 'vertical',
        right: 40,
        top: 10,
        bottom: 10,
        itemWidth: 30,
        itemHeight: 12,
        itemGap: 12,
        borderRadius: 0,
      },
      series: [
        {
          type: 'pie',
          center: ['30%', '50%'],
          radius: ['0%', '50%'],
          label: {
            normal: {
              position: 'outside',
              formatter: '{d}%',
              fontSize: 12,
            },
          },
          data: [],
        },
      ],
    }
  }
}
